package com.openingedu.mba.screen.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentTabHost;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.actionbarsherlock.app.SherlockFragment;
import com.openingedu.mba.MainActivity;
import com.openingedu.mba.R;

public class FragmentStoreServer extends SherlockFragment {
	private Context mContext;
	private FragmentTabHost mTabHost;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		Log.e("--------", "onCreateView");
		setTitleName();
		mContext = inflater.getContext();
		if (mTabHost == null) {
			mTabHost = new FragmentTabHost(getSherlockActivity());
			mTabHost.setup(getSherlockActivity(), getChildFragmentManager(), R.layout.ft_store_server);
			
			mTabHost.addTab(mTabHost.newTabSpec("s_logic").setIndicator("逻辑"), FragmentServerTabLogic.class, null);
//			mTabHost.addTab(mTabHost.newTabSpec("s_math").setIndicator("数学"), FragmentServerTabMath.class, null);
		}
        return mTabHost;
	}

	@Override
	public void onPause() {
		super.onPause();
		Log.e("--------", "storeLocal onPause");
	}

	@Override
	public void onResume() {
		super.onResume();
		Log.e("--------", "storeLocal onResume");
  	}
	
	private void setTitleName() {
		if (getActivity() == null) {
			return;
		}
		MainActivity ra = (MainActivity) getActivity();
		ra.setTitleName("网络题库");
	}
}
